package org.deng.learn.async;

/**
 * @author 邓力宾
 * @date 2020/12/23 9:35
 * @desc
 */
public class Main {
    public static void main(String[] args) throws InterruptedException {
        MyExecutor executor = new MyExecutor();
        MyFuture<String> future = executor.execute("hello");
        future.onComplete((AsyncResult<String> result) -> {
            if(result.isSucceed()){
                System.out.println("执行成功结果为:"+result.getResult());
            }else {
                System.out.println("执行失败");
            }
        });

    }
}
